package com.zzs.server.service.impl;

import com.zzs.common.minio.entity.File;
import com.zzs.common.minio.service.MinioService;
import com.zzs.server.service.FileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;


/**
 * @author zzs
 * @date 2025/03/21
 */
@Service
@Slf4j
public class FileServiceImpl implements FileService {
    @Autowired
    private MinioService minioService;

    @Override
    public File uploadImage(MultipartFile file) {
        try {
            return minioService.uploadImage(file);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void removeFiles(List<String> fileNameList) {
        minioService.removeFiles(fileNameList);
    }
}
